home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
tpaint
/
iff2tpaint.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-01-29
|
3KB
|
93 lines
/* Map iff to ToasterPaint canvas */
/* By Arnie Cachelin © 1992 NewTek Inc */
/* 01 Dec 1991 At 23:07:52 */
/*
This program will load a standard Amiga IFF image, and map it to fill the
ToasterPaint canvas. Give it a full file name to load. Optional
parameters are an output name, to save the RGB image, and a blur switch.
If there is any third parameter given, then Blur will be used, and the
whole picture will be blurred once. This helps smooth the pixels and color
bands in lower resolution or color images. To turn the blur on without
saving the frame, use 'NIL:' as your save name.
*/
ARG iffname outname blur
Address "DigiPaint" /* Tell ARexx where commands go */
if pos('DigiPaint',show(ports))=0 then do
say "Can't find ToasterPaint!"
exit
end
PageWide=752
PageHigh=480
'Bdel' /* Delete swap brush */
Call LoadBrush(iffname)
'Bcop' /* Copy Brush to swap brush */
'Maxe' /* Set edge blend level to max */
'Maxc' /* Set center blend level to max */
'Cbx0' /* Choose color 0 (black) */
'Clrs' /* Clear the screen */
Call MapBrush(0,0,PageWide,PageHigh)
if Blur~="" Then do
'Blur'
'Redo'
end
if Outname~="" & OutName~="NIL:" then do
Call SaveRGB(outname)
end
'Shco'
exit
MapBrush: PROCEDURE /* Size swap brush into rectangle with corners at (x1,y1) and (x2,y2) */
arg x1, y1, x2, y2 /* if there is no swap brush, whole screen is used! */
'Pmcl' /* Normal draw Mode */
'Hvof' /* Turn off gradient blend (center=edge) */
'Maxc' /* Set transparency off */
'Flon' /* Fill On */
'Aaon' /* Anti-alias on */
'Txma' /* Texture mapping on, fill on, draw rectangles */
'Drre' /* Draw Rectangles */
'Pend' x1 y1 /* Get in top Left corner */
'Penu' x2 y2 /* lift pen */
'Flof' /* fill off */
'Pmcl' /* Normal draw Mode */
return
SetFile: PROCEDURE /* Select file in current requester */
arg file
dirname=GetPathName(file)
'Dnam'dirname /* Enter file path */
'Dsel' /* Hit return on directory */
filename=GetFileName(file)
'Fnam'filename /* Enter File name */
'Okls' /* Hit the OK button */
return
SaveRGB: PROCEDURE /* Load Brush, copy into swap buffer */
arg filename
'Sa24' /* Call file requester */
Call SetFile(filename)
return
LoadBrush: PROCEDURE /* Load Brush */
arg filename
'Lobr' /* Call file requester */
Call SetFile(filename)
return
GetFileName: procedure /* Extract file name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return substr(fullfile, c + 1)
GetPathName: procedure /* Extract directory name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return left(fullfile,c)